﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IceLiteDataAccess;
using IceLiteDataAccess.POCO;

namespace IceLiteWebClient.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to kick-start your ASP.NET MVC application.";
            using (var fContext = new IceLiteContext())
            {
                fContext.Users.Add(new User() {Name = "tanmoy"});
                fContext.SaveChanges();
            }
         using (var work = new UnitOfWork())
         {
            IUserRepository userRepo = new UserRepository(work);
             var user = userRepo.FindBy(b => b.Id == 1);
         }

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
